package com.sihan.framework.etm.controller.business;

import com.framework.annotation.BusinessLog;
import com.framework.model.ApiResult;
import com.sihan.framework.etm.service.business.GeneralService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author gyz
 * @version 1.0
 * @since jdk1.8
 */
@Api(tags = "通用接口")
@RestController
@RequestMapping("/bs/v0/general")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class GeneralController {

	private final GeneralService generalService;

	@ApiOperation(value = "根据工器具类型Id查询工器具", notes = "根据工器具类型Id查询工器具", response = Map.class)
	@GetMapping("/getToolListByTypeId")
	@BusinessLog(value = "根据工器具类型Id查询工器具")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "typeId", value = "工器具类型", dataType = "string", paramType = "query")
	})
	public ApiResult<?> getToolListByTypeId(String typeId){
		return ApiResult.success(generalService.getToolListByTypeId(typeId));
	}
}
